From aa18bbf0ed32e33aa935e306fd2dc78742abec2f Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Wed, 13 Feb 2002 05:48:56 +0000 Subject: [PATCH] partly revert my recent expanding change to not expand the table if all Wed Feb 13 06:42:37 2002 Tim Janik * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert my recent expanding change to not expand the table if all children have not epxand behaviour. this fixes palette views which often use homogeneous non-expanding tables. --- ChangeLog | 7 +++++ ChangeLog.pre-2-0 | 7 +++++ ChangeLog.pre-2-10 | 7 +++++ ChangeLog.pre-2-2 | 7 +++++ ChangeLog.pre-2-4 | 7 +++++ ChangeLog.pre-2-6 | 7 +++++ ChangeLog.pre-2-8 | 7 +++++ gtk/gtktable.c | 67 +++++++++++++++++++++++++++++++++------------- 8 files changed, 97 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7355b6e1ba..8a22df19d0 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Wed Feb 13 06:42:37 2002 Tim Janik + + * gtk/gtktable.c (gtk_table_size_allocate_pass1): partly revert + my recent expanding change to not expand the table if all children + have not epxand behaviour. this fixes palette views which often + use homogeneous non-expanding tables. + Tue Feb 12 14:27:41 2002 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit diff --git a/gtk/gtktable.c b/gtk/gtktable.c index 68e2fef02a..da962fb68d 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -1335,16 +1335,30 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->homogeneous) { - width = real_width; - - for (col = 0; col + 1 < table->ncols; col++) - width -= table->cols[col].spacing; - - for (col = 0; col < table->ncols; col++) + if (!table->children) + nexpand = 1; + else { - extra = width / (table->ncols - col); - table->cols[col].allocation = MAX (1, extra); - width -= extra; + nexpand = 0; + for (col = 0; col < table->ncols; col++) + if (table->cols[col].expand) + { + nexpand += 1; + break; + } + } + if (nexpand) + { + width = real_width; + for (col = 0; col + 1 < table->ncols; col++) + width -= table->cols[col].spacing; + + for (col = 0; col < table->ncols; col++) + { + extra = width / (table->ncols - col); + table->cols[col].allocation = MAX (1, extra); + width -= extra; + } } } else @@ -1412,17 +1426,32 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->homogeneous) { - height = real_height; - - for (row = 0; row + 1 < table->nrows; row++) - height -= table->rows[row].spacing; - - - for (row = 0; row < table->nrows; row++) + if (!table->children) + nexpand = 1; + else + { + nexpand = 0; + for (row = 0; row < table->nrows; row++) + if (table->rows[row].expand) + { + nexpand += 1; + break; + } + } + if (nexpand) { - extra = height / (table->nrows - row); - table->rows[row].allocation = MAX (1, extra); - height -= extra; + height = real_height; + + for (row = 0; row + 1 < table->nrows; row++) + height -= table->rows[row].spacing; + + + for (row = 0; row < table->nrows; row++) + { + extra = height / (table->nrows - row); + table->rows[row].allocation = MAX (1, extra); + height -= extra; + } } } else -- 2.30.2